package JoReg

var nameArr = [7]string{"t0", "t1", "t2", "t3", "t4", "t5", "t6"}

type Assign struct {
	nameIndex int
}

func MakeAssign() *Assign {
	return &Assign{nameIndex: 0}
}

func (this *Assign) getName() string {
	if this.nameIndex >= len(nameArr) {
		this.nameIndex = 0
	}
	varName := nameArr[this.nameIndex]
	this.nameIndex++
	return varName
}

func (this *Assign) freeName() {
	this.nameIndex--
	if this.nameIndex < 0 {
		this.nameIndex = 0
	}
}
